# for循环: 用来重复执行某些代码

# 语法: for 变量(名字随意) in 序列:
# 序列: 字符串,列表,元组,字典,集合等,里面有多个元素

for i in 'hello':
    print("当前的字母是:", i)

print("-" * 50)

# 求这几位同学平均分和最高分
scores = [88, 79, 90, 65, 80]
max_value = 0
for score in scores:
    print("当前的成绩是:", score)
    if max_value < score:
        print("max_value = {}, score = {},因为max_value < score"
              "所以把score赋值给max_value".format(max_value, score))
        max_value = score
    else:
        print("max_value = {}, score = {},因为max_value >= score"
              "所以不赋值".format(max_value, score))

